<%@page import="java.io.File"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生信息管理系统登录</title>
<script type="text/javascript">
//清空登录信息
function resetValue() {
	document.getElementById("name").value="";
	document.getElementById("pwd").value="";
}
</script>
</head>

<%  
System.out.println("*************************** Index.jsp Begin ****************************");
System.out.println("当前WEB应用的物理路径："+application.getRealPath("/"));
System.out.println("当前你求请的JSP文件的物理路径："+application.getRealPath(request.getRequestURI()));
/* String path=application.getRealPath(request.getRequestURI());  
String dir= new File(path).getParent();  
out.println("当前JSP文件所在目录的物理路径"+dir+"</br>");   */
String realPath1 = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath()+request.getServletPath().substring(0,request.getServletPath().lastIndexOf("/")+1);   
/* out.println("web URL 路径:"+realPath1);  */
System.out.println("当前你求请的JSP文件的物理路径："+realPath1);
System.out.println("getUserName："+request.getAttribute("userName"));
System.out.println("getPassword："+request.getAttribute("password"));
System.out.println("*************************** Index.jsp End ****************************");
%>  
<body>
	<div align="center" style="padding-top: 50px;">
		<form action="login" method="post">
		<table width="740" height="500" background="./images/login.jpg" border="0">
			<tr height="180">
				<td colspan="4"></td>
			</tr>
			<tr height="10">
				<td width="40%"></td>
				<td width="10%">用户名：</td>
				<td >
					<input type="text" name="userName" id="name" value="${userName }" />
				</td>
				<td width="30%"></td>
			</tr>
			<tr height="10">
				<td width="40%"></td>
				<td width="10%">密&nbsp;&nbsp;&nbsp;码：</td>
				<td >
					<input type="password" name="password" id="pwd" value="${password }" />
				</td>
				<td width="30%"></td>
			</tr>
			<tr height="10" align="center">
				<td width="40%"></td>
				<td width="15%">
					<input type="submit" value="登录"/>
				</td>
				<td width="15%">
					<input type="button" value="重置" onclick="resetValue()"/>
				</td>
				<td width="30%"></td>
			</tr>
			<tr height="10">
				<td width="40%"></td>
				<td colspan="3">
					<font color="red">${error }</font>
				</td>
			</tr>
			<tr>
				<td></td>
			</tr>
		</table>
		</form>
	</div>
</body>
</html>